package com.example.mybatisdemo1.controller;

import com.example.mybatisdemo1.entity.UserInfo;
import com.example.mybatisdemo1.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author hyacinth
 * @date 2023/5/11
 */
@RestController
@RequestMapping("/user")
public class Usercontroller {

    @Autowired
    private UserService userService;
    @RequestMapping("/getuserbyid")
    public UserInfo getUserById(Integer id){
        if (id==null){
            return null;
        }
        return userService.getUserById(id);
    }
}
